package com.mininglamp.app;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;

import com.google.common.base.Strings;
import com.mininglamp.app.util.ConfigHelper;
import com.mininglamp.app.util.Log4j;

public class App {

	private static final Logger log = LoggerFactory.getLogger(App.class);

	public static final String APP_DIR = System.getProperty("app.dir", "");

	public static void main(String[] args) {
		if (Strings.isNullOrEmpty(APP_DIR)) {
			log.error("app.dir is null, please use '-Dapp.dir=<dir>' option");
			System.exit(1);
		}
		Log4j.configure();

		log.info("ConfigHelper = {}", ConfigHelper.INSTANCE);

		SpringApplication.run(Application.class, args);
	}

}